<?php
function d($arr) {
  echo '<pre>';
  print_r($arr);
  echo '</pre>';
}
function encodeFilename($filename) {
  $filename = preg_replace("/[^a-zA-Z0-9-.]/", "_", $filename);
  return $filename;
}
// function trim for all $_POST before save db
function trim_data($data) {
  foreach ($data as $key => $value) {
    if(is_array($value)) {
      $data[$key] = trim_data($value);
    }
    else {
      $data[$key] = trim($value);
    }
  }
  return $data;
}
function getNoOrder($no)
{
  return '<i class="icon-move"></i> ' . $no;
}